<style type="text/css">
	#tpl-file-tool-id{
		padding:0px 20px ;
	}

	#tpl-file-tool-id .icon{height: 38px;line-height: 38px;text-align: center;}
	#tpl-file-tool-id .icon i{font-size: 2rem;font-weight: 800;color: blue;margin-left: 1rem;margin-right: 1rem;cursor: pointer;color: #717171}
	.tpl-file-tool-id-collect{
		color: #ffb800 !important;
	}
	.admin-menu-page-title{padding: 15px;background-color: white;margin-bottom: 5px;cursor: pointer;}
</style>
<script type="text/html" id='tpl-admin_menu'>
<div id='tpl-file-tool-id'>
	<div class="admin-menu-page-title" onclick="app.go('/admin/home')"><h2>系统管理</h2></div>
	<div class="admin_menu">
		<div class="layui-panel">
			<ul class="layui-menu" id="AdminMenu">
				<li lay-options="{id: 104}" url='/admin/file/import'>
					<div class="layui-menu-body-title">导入文件</div>
				</li>
				<li lay-options="{id: 104}" url='/admin/user'>
					<div class="layui-menu-body-title">用户管理</div>
				</li>
				<li lay-options="{id: 104}" url='/admin/offineDownload'>
					<div class="layui-menu-body-title">离线下载</div>
				</li>
			</ul>
		</div>
	</div>
</div>
</script>
<script type="text/javascript">
	app.defTpl('admin_menu',function(arg){
		layui.use(['layer','laytpl','dropdown'],function(){
			var laytpl = layui.laytpl,$=layui.$;
			var dropdown = layui.dropdown;
			laytpl($('#tpl-admin_menu').html()).render({}, function(html){
				$(arg.elem).html(html)

				// 设置选中项
				$('[url="'+app.parseUrl().source+'"]').addClass("layui-menu-item-checked")

				//菜单点击事件，其中 docDemoMenu1 对应的是菜单结构上的 id 指
				dropdown.on('click(AdminMenu)', function (options) {
					var othis = $(this); //当前菜单列表的 DOM 对象
					console.log(options); //菜单列表的 lay-options 中的参数
					app.go(othis.attr("url"))
					// othis.css("color","pink")
				});

			});

	
			
		})
	})
	
</script>